href = location.pathname;

$.ajax({
  type: "get",
  url: "/ctm_leftNav",
  data: { href },
  success: function(data) {
    console.log(data);
    if (data.code == "1001") {
      let html = template("products_All", {
        idNum: data.data2[1][0].num,
        list: data.data2[0]
      });
      $(".products_list").html(html);
    } else if (data.code == "1000") {
      let html = template("products_Item", { list: data.data2 });
      $(".products_list").html(html);
    } else if (data.code == "1002") {
      let html = template("products_Item", { list: data.data2[1] });
      $(".products_list").html(html);
      let left_nav_html = template("left_nav", { list: data.data2[0] });
      $(".com_sidebar_top_hbody").html(left_nav_html);
    }
  }
});
